/**
  * SmartDock.h
  * 
  * Copyright (c) 2013 by <zhuyu / organization here>
  */

#ifndef SMART_DOCK_H
#define SMART_DOCK_H

#include <QWidget>
#include <vector>
#include <QHBoxLayout>
#include "SmartDockItem.h"

class QPushButton;

class SmartDock : public QWidget{
	Q_OBJECT
public:
	SmartDock(QWidget *parent = 0, Qt::WFlags flags = 0);
	
	virtual ~SmartDock();

	bool AddItem(SmartDockItem* pb);
	void SetHeight(int height = 100);

	int currentIndex() const;
	QWidget* currentWidget() const;
	int count() const;

	public slots:
		void itemChanged(SmartDockItem* item);

Q_SIGNALS:
	void currentChanged(int index);

private:
	void createBackground();
	void createTestPuttons();
	void updateItems();

private:
	std::vector<SmartDockItem*> m_buttons;
	SmartDockItem* m_current;
	QHBoxLayout*  m_mainLayout;
	int m_height;
}; 
#endif
